<?php
namespace Admin\Controller;
use Think\Controller;
class DelAdController extends Controller {
    public function delAd(){
        
        isMyCookie();
        isLogin();
        
        $Ad=M("advertising");
        
        //var_dump("AAA");exit();
        //$field=$Info->getInfoField();
        
        $where["id"]=$_POST['id'];
        //var_dump($where);exit();
        //$data['checkstate']=1;
        //$count=$Info->count();
        //$Page=getMyPage($count,10);
        //$show=$Page->show();
       // $list=$Info->field($field)->order('edate desc')->limit($Page->firstRow.','.$Page->listRows)->select();
        
        //$this->assign('page',$show);
        //$this->assign('list',$list);
        
        //$this->display();
        if ($Ad->where($where)->delete()>0){
            echo "删除成功";
        }else {
            echo "删除失败";
        }
    }
    
    public function delAdAll(){
         
        isMyCookie();
        isLogin();
        
        $Ad=M("advertising");
        //$field=$Info->getInfoField();
    
        //$map['type']=array('eq',$type);
         
        //$where["id"]=$_POST['id'];
        $ids=$_POST['id'];
        $where["id"]=array('in',$ids);
        //print_r($where);exit();
      //  $data['flag']=1;
        //$count=$Info->count();
        //$Page=getMyPage($count,10);
        //$show=$Page->show();
        // $list=$Info->field($field)->order('edate desc')->limit($Page->firstRow.','.$Page->listRows)->select();
    
        //$this->assign('page',$show);
        //$this->assign('list',$list);
    
        //$this->display();
    if ($Ad->where($where)->delete()>0){
            echo "删除成功";
        }else {
            echo "删除失败";
        }
    }
}